﻿/************************************************

* Function： N/A
* Name： DamageNumberRenderPass
*
* Ver       Time                     Author
* 0.10      2023/1/12 9:53:20       ake
*
**************************************************/


using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

namespace Common
{
    public class DamageNumberRenderPass: ScriptableRenderPass
    {
        //public static int ScaledScreenParamPropertyId = Shader.PropertyToID("_CustomScaledScreenParam");

        public DamageNumberRenderPass(RenderPassEvent rpe)
        {
            renderPassEvent = rpe;
        }
        public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
        {
            CommandBuffer cb = RenderFunctionSlot.GetDamageNumberCommandBufferFunction != null
                ? RenderFunctionSlot.GetDamageNumberCommandBufferFunction()
                : null;
            if (cb == null)
            {
                return;
            }
            // Vector4 param = Vector4.zero;
            // param.x = ScreenDefine.BattleRtWidth;
            // param.y = ScreenDefine.BattleRtHeight;
            // cb.SetGlobalVector(ScaledScreenParamPropertyId,param);
            context.ExecuteCommandBuffer(cb);
        }
    }
}

